expm1
Returns exp(number) - 1, and can calculate the exact result even when the value of number is close to zero.
expm1()
function returns exp(x) - 1, and can calculate the exact result even when the value of number is close to zero.
In this example, we will apply the expm1() function to different numbers:
<?php echo ( expm1 ( 1 ) ) ; echo ( expm1 ( - 1 ) ) ; echo ( expm1 ( 5 ) ) ; echo ( expm1 ( 10 ) ) ?>
Try it yourself
expm1 ( x )
parameter | describe |
---|---|
x | Required. A number. |
expm1()
returns 'exp(x) - 1', and the accurate result can be calculated even when the value of x is close to zero. But when two values approach equal, 'exp (x) - 1' becomes inaccurate.